package com.colabo.j2ee.web.core.dictionary;

import java.util.List;
import java.util.Map;

import com.colabo.j2ee.web.core.exception.ServiceException;

public interface ICodeInfoService {
	public final static String BEAN_ID = "codeInfoService";

	public IPCodeTypeVO getCodeTypeByTypeKy(String typeKy) throws ServiceException;

	public IPCodeTypeVO getCodeTypeByTypeCode(String typeCode) throws ServiceException;

	/**
	 * 获得所有编码类型信息列表,分页
	 * 
	 * @param offset
	 * @param pageSize
	 * @return
	 * @throws ServiceException
	 */
	public List getAllCodeTypes(int offset, int pageSize) throws ServiceException;

	/**
	 * 获得所有编码类型信息列表,不分页
	 * 
	 * @return
	 * @throws ServiceException
	 */
	public List getAllCodeTypes() throws ServiceException;

	/**
	 * 获得所有的编码类型数量
	 * 
	 * @return
	 * @throws ServiceException
	 */
	public int getAllCodeTypeCount() throws ServiceException;
	
	/**
	 * 根据条件获得编码类型数量
	 * @param para
	 * @return
	 * @throws ServiceException
	 */
	public int getCodeTypeCountByMap(Map para) throws ServiceException ;
	
	/**
	 * 根据条件获得编码类型列表，分页
	 * @param offset
	 * @param pageSize
	 * @param para
	 * @return
	 * @throws ServiceException
	 */
	public List getCodeTypesByMap(int offset, int pageSize,Map para) throws ServiceException;

	public void batchCommitCodeType(List insertBeans, List updateBeans, List delBeans) throws ServiceException;

	public String batchCommitCodeInfo(IPCodeTypeVO codeType, List insertBeans, List updateBeans, List delBeans)
			throws ServiceException;

	/**
	 * 根据codeType获得codeInfo list
	 * 
	 * @param codeType
	 *            code类型
	 * @return
	 * @throws ServiceException
	 */
	public List getCodeInfoByCodeType(String codeType) throws ServiceException;

	/**
	 * 根据编码类型获得编码信息列表，分页
	 * 
	 * @param codeType
	 * @param offset
	 * @param pageSize
	 * @return
	 * @throws ServiceException
	 */
	public List getCodeInfoByCodeTypeKy(String codeTypeKy, int offset, int pageSize) throws ServiceException;

	/**
	 * 根据编码类型获得编码信息列表，不分页
	 * 
	 * @param codeType
	 * @return
	 * @throws ServiceException
	 */
	public int getCodeInfoCountByCodeTypeKy(String codeTypeKy) throws ServiceException;

	/**
	 * 根据codetypeCode获得codetype对象
	 * 
	 * @param codeType
	 * @return
	 * @throws ServiceException
	 */
	public IPCodeTypeVO getCodeTypeVOByTypeCode(String codeType) throws ServiceException;

	/**
	 * 根据codeinfoCode获得 codeinfo对象
	 * 
	 * @param codeinfoCode
	 * @return
	 * @throws ServiceException
	 */
	public IPCodeInfoVO getCodeInfoVOByInfoCode(String codeTypeCode, String codeinfoCode) throws ServiceException;

	public IPCodeInfoVO getCodeInfoVOByInfoCodeAndTypeKy(String codeTypeKy, String codeinfoCode)
			throws ServiceException;

	public IPCodeInfoVO getCodeInfoVOByKy(String codeinfoky) throws ServiceException;

	/**
	 * 查询当前code的所有子节点
	 * 
	 * @param codeInfoCode
	 * @return
	 * @throws ServiceException
	 */
	public List getChildCodeInfoList(String codeType, String codeInfoCode) throws ServiceException;

	public List getChildCodeInfoListByKy(String codeTypeKy, String codeInfoCode) throws ServiceException;

	/**
	 * 查询当前节点一级字节点
	 * 
	 * @param codeInfoCode
	 * @return
	 * @throws ServiceException
	 */
	public List getOneLevelChildCodeInfoList(String codetypeCode, String codeInfoCode) throws ServiceException;

	/**
	 * 从fromLev级到toLev级查询当前节点的子节点
	 * 
	 * @param codeInfoCode
	 * @param fromlev
	 * @param toLev
	 * @return
	 * @throws ServiceException
	 */
	public List getChildCodeInfoByLevel(String codetypeCode, String codeInfoCode, int fromLev, int toLev)
			throws ServiceException;

	/**
	 * 查询当前节点的父节点
	 * 
	 * @param codeInfoCode
	 * @return
	 * @throws ServiceException
	 */
	public IPCodeInfoVO getParentCodeInfo(String codetypeCode, String codeInfoCode) throws ServiceException;

	/**
	 * 查询当前节点的所有父节点
	 * 
	 * @param codeInfoCode
	 * @return
	 * @throws ServiceException
	 */
	public List getAllParentCodeInfoList(String codetypeCode, String codeInfoCode) throws ServiceException;


	public List getFirstLevelCodeInfoByCodeType(String codeType) throws ServiceException;

	public List selectParentCodeByCodeTypeKy(String codeTypeKy, String codeinfoCode, int offset, int pageSize)
			throws ServiceException;

	public int selectCodeCountByCodeTypeKy(String codeTypeKy, String codeinfoCode) throws ServiceException;

	public String getCodeTypeKyTypeCode(String typeCode) throws ServiceException;

	public int getCodeInfoCountByCodeTypeKyForPage(String codeType) throws ServiceException;

	public List getAllCodeInfo() throws ServiceException;
}
